{include file="public/head"}

<body>
<div id="wrapper">

    <div class="gray-bg dashbard-1">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                            <form class="form-horizontal m-t" id="commentForm">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">等级名称：</label>
                                    <div class="col-sm-8">
                                        <input id="name" name="name" value="{$LevelInfo.name}" minlength="2" type="text" class="form-control" required="" aria-required="true">
                                    </div>
                                </div>
                                <div class="form-group up_level">
                                    <label class="col-sm-3 control-label">升级条件：</label>
                                    <div class="col-sm-8">
                                        <div class="input-group">
                                            <input id="number" name="number" value="{$LevelInfo.number}" type="text" class="form-control"  aria-required="true" onkeyup="value=value.replace(/[^\d]+/g,'')" >

                                            <div class="input-group-addon">个</div>
                                        </div>
                                    </div>
                                </div>
                                <!--<div class="form-group up_level">-->
                                <!--    <label class="col-sm-3 control-label">团队累计：</label>-->
                                <!--    <div class="col-sm-8">-->
                                <!--        <div class="input-group">-->
                                <!--            <input id="teamall" name="teamall" value="{$LevelInfo.teamall}" type="text" class="form-control"  aria-required="true" onkeyup="value=value.replace(/[^\d]+/g,'')" >-->
                                <!--            <div class="input-group-addon">台</div>-->
                                <!--        </div>-->
                                <!--    </div>-->
                                <!--</div>-->
                                <!--<div class="form-group up_level">-->
                                <!--    <label class="col-sm-3 control-label">考核业绩(月)：</label>-->
                                <!--    <div class="col-sm-8">-->
                                <!--        <div class="input-group">-->
                                <!--            <input id="month_money" name="month_money" value="{$LevelInfo.month_money}" type="text" class="form-control" required="" aria-required="true" onkeyup="value=value.replace(/[^\d]+/g,'')" >-->
                                <!--            <div class="input-group-addon">元</div>-->
                                <!--        </div>-->
                                <!--    </div>-->
                                <!--</div>-->
                                <input type="hidden" id="id" value="{$LevelInfo.id}">
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <button class="btn btn-primary" type="submit">确认提交</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>


</div>
<!-- Mainly scripts -->
<script src="__STATIC__/Admin/js/jquery-2.1.1.min.js"></script>
<script src="__STATIC__/Admin/js/bootstrap.min.js?v=3.4.0"></script>
<script src="__STATIC__/Admin/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="__STATIC__/Admin/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/Admin/layer/layer.js"></script>

<script>
    // $(".up_level").hide();
    //
    // var level = "{$LevelInfo.id}";
    // if(level >= 3){
    //     $(".up_level").show()
    // }else{
    //     $(".up_level").hide()
    // }

    $('form').submit(function (e) {
        e.preventDefault();
        $.ajax({
            type:"post",
            url:"{:url('Level/LevelEdit')}",
            data:{
                id:$('#id').val(),
                name:$('#name').val(),
                number:$('#number').val(),
                // teamall:$('#teamall').val(),
                // month_money:$('#month_money').val(),

            },
            dataType:"json",
            success:function(data){
                if(data.status == 1){
                    layer.msg(data.message,{icon: 6,time:1500},function () {
                        window.top.location.reload();
                    });
                }else{
                    layer.msg(data.message,{icon: 5,time:1500});
                }
            }
        })
    })
</script>
</body>

</html>
